<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="../plugins/vue.min.js"></script>
  </head>
  <body>
    <div id="box">
      <!-- if else -->
      <div v-if="isCreate">1111</div>
      <div v-else>222</div>
      <ul>
        <!-- in -->
        <li v-for="data of dataList" :key="data.id">
          {{data.title}}--
          <span v-if="data.status===0">未发货</span>
          <span v-else-if="data.status===1">已发货</span>
          <span v-else-if="data.status===2">未签收</span>
          <span v-else>已签收</span>
        </li>
      </ul>

      <!-- template 包装 不会渲染到页面上面 -->
      <template v-if="isCreate">
        <div>1111</div>
        <div>22222</div>
        <div>444</div>
      </template>
    </div>

    <script>
      let vm = new Vue({
        el: "#box",
        data: {
          isCreate: true,
          // 可以在下面加上id
          dataList: [
            {
              // id:1,
              title: 111,
              status: 0,
            },
            { title: 112, status: 1 },
            { title: 113, status: 2 },
            { title: 114, status: 3 },
          ],
        },
      });
    </script>
  </body>
</html>
